package cn.itsource.ymcc.feignclient;

import cn.itsource.ymcc.domain.CourseDoc;
import cn.itsource.ymcc.feignclient.fallbackfactory.SearchFeignClientFallbackFactory;
import cn.itsource.ymcc.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-search",fallbackFactory = SearchFeignClientFallbackFactory.class)
public interface SearchFeignClient {
    @PostMapping("/es/save")
    public JsonResult save(@RequestBody List<CourseDoc> courseDoc);
    @PostMapping("/es/search")
    public JsonResult search(@RequestBody CourseDoc courseDoc);
    @PostMapping("/es/delete")
    public JsonResult delete(@RequestBody List<Long> courseIds);
    @GetMapping("/es/selectOneByCourseId/{courseId}")
    public JsonResult selectOneByCourseId(@PathVariable("courseId")Long courseId);
    @PostMapping("/es/selectBatchById")
    public JsonResult selectBatchById(@RequestBody List<Long> courseIds);
}
